
<?php Yii::app()->clientScript->registerScript('list', <<<DOCHERE

   var dispatch= '$dispatch->dispatch';
 
    Ext.onReady(function(){
        var store=Ext.create('Ext.data.Store',{
            model:'Dispatchtask',
            pageSize:20,
            autoLoad:true,
            proxy:{
                type:'ajax',
                url:'index.php?r=dispatchtask/list&dispatch='+dispatch,
                reader:{
                    type:'json',
                    root:'data',
                    totalProperty:'totalCount'
                }
            }
        })
        Ext.create('Ext.ux.LiveSearchGridPanel',{
            store:store,
            height: 450,
            width: grid_width,
            title: 'Task List',
            renderTo: 'task-list',
            viewConfig: {
                stripeRows: true
            },
          
            bbar: new Ext.PagingToolbar({
                pageSize: 20,
                store:store,
                displayInfo: true,
                displayMsg: 'Displaying topics {0} - {1} of {2}',
                emptyMsg: 'No topics to display'

            }),
            columns:[        
        
               {
               
                    text:'Taskname',
                    flex:1,
                    dataIndex:'taskname',
                    renderer:function(value,p,record){
                        return Ext.String.format('<a href="index.php?r=dispatchtask/update&dispatch={1}&taskname={0}">{0}</a>',record.data.taskname,record.data.dispatch);
 //                             return Ext.String.format('<a href="index.php?r=dispatchtask/update&dispatch={0}&taskname={0}">{0}</a>',record.data.taskname);
                    }
                },                
                {
                    text:'Short Description',
                    flex:1,
                    dataIndex:'shortdescription'
                },
                {
                    text:'Time Min',
                    flex:1,
                    dataIndex:'timemin'
                },
                {
                    text:'Long Description',
                    flex:1,
                    dataIndex:'longdescription'
                },
                {
                    text:'skill',
                    flex:1,
                    dataIndex:'skill'
                },
                {
                    text:'Dispatch',
                    flex:1,
                    dataIndex:'dispatch'
                },
                {
                    text:'Actions',
                    flex:1,
                    renderer:function(value,p,record){
                        return Ext.String.format('<a href="index.php?r=dispatchtask/delete&taskname={0}"><img src="images/delete.png"/></a>',record.data.taskname  );
                    }
                }
            ]

        });
    });
DOCHERE
        , CClientScript::POS_BEGIN); ?>

<div id="left-col">
    <?php
    $this->renderPartial('_side', array(
        'dispatch'=>$dispatch,
        'location'=>$location
    ));
    ?>



</div>

<div id="right-col">

    <div class="wrap">
        <div class="container">


            <div id="breadcrumb" style="display:none;"><span style="padding-left:10px;font-size:10px;color:#777777;" id="alsoviewing"></span></div>
            <div class="inside">

          
                <?php
                $this->renderPartial('/dispatchdetails/_tab', array(
                    'model' => $dispatch,
                ));
                ?>
                <br/>




                <div id="task-list">

                </div>

            </div><!-- inside -->
        </div><!-- container -->
    </div><!-- wrap -->
<?php $this->renderPartial('application.views.copyright'); ?>
</div> <!-- left-col -->